﻿/**
 *
 * cs1237.h
 *
 *  Created on: 2019-11-19
 *      Author: chenshisheng
 */

#ifndef INC_CS1237_H_
#define INC_CS1237_H_

#include "main.h"
#include "hw.h"

typedef struct
{
    HW_t dout;
    HW_t sclk;
}CS1237_Bus_t;

void CS1237_Init(const CS1237_Bus_t *bus);
bool CS1237_IsNewDataReady(const CS1237_Bus_t *bus);
int8_t CS1237_Read(const CS1237_Bus_t *bus, int32_t *weight);
void CS1237_PowerDownCmd(const CS1237_Bus_t *bus, bool state);

#endif /* INC_CS1237_H_ */
